package Common

type OrderStatus int

/*
@UNPAY 未支付
@PADYED 已支付
@CONSIGNMENT 已发货
@CONFIRM 已收货
@SUCCESS 已完成
@CLOSE 已关闭
1:未支付 2:已支付 3:已发货 4:已确认 5:已完成 6:已关闭
*/
const (
	UNPAY OrderStatus = iota + 1
	PADYED
	CONSIGNMENT
	CONFIRM
	SUCCESS
	CLOSE
)

func (os OrderStatus) Value() int {
	return int(os)
}

// Instance 输入字符串返回常量/*
func Instance(value int) OrderStatus {
	switch value {
	case 1:
		return UNPAY
	case 2:
		return PADYED
	case 3:
		return CONSIGNMENT
	case 4:
		return CONFIRM
	case 5:
		return SUCCESS
	case 6:
		return CLOSE
	default:
		return 0
	}
}
